console.log('开始canvas绘制之旅')
let canvas=document.getElementById('canvas')

// 元素大小
canvas.style.width='400px'
canvas.style.height='200px'

// 绘制区域的宽高
// 电视，ipad 手机
// canvas 容器宽高，绘制区域大小设置
canvas.width=400
canvas.height200

// 绘制上下文
const context = canvas.getContext('2d')
context.fillStyle='red'
context.strokeStyle='yellow'

context.lineWidth=10
context.strokeRect(0,0,100,100) // 绘制边框
context.fillRect(5,5,95,95)

context.fillStyle='black'
context.font='25px PingFangSC-Regular,sans-serif'
context.fillText('hello world',150,100)
